﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:nControls="clr-namespace:nRoute.Controls;assembly=nRoute.Framework" 
	    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
	    xmlns:nBehaviors="clr-namespace:nRoute.Behaviors;assembly=nRoute.Framework" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="nRoute.Samples.SimpleMVVM.MainWindow" 
        Title="Simple MVVM" Height="600" Width="800">
	<i:Interaction.Behaviors>
		<nBehaviors:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>
    
	<Grid x:Name="LayoutRoot">

		<Grid.Background>
			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
				<GradientStop Color="Black" Offset="0"/>
				<GradientStop Color="White" Offset="1"/>
			</LinearGradientBrush>
		</Grid.Background>
		<Grid.RowDefinitions>
			<RowDefinition Height="54"/>
			<RowDefinition/>
		</Grid.RowDefinitions>
		<nControls:StatefulBrowsingContainer Grid.Row="1" Url="Pages/PageA">
			<i:Interaction.Behaviors>
				<nBehaviors:NavigationHandlerBehavior IsDefaultHandler="True"/>
			</i:Interaction.Behaviors>
		</nControls:StatefulBrowsingContainer>
		
		<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
			<Button Width="30" Content="3" BorderThickness="1" Margin="10,0,5,0" Height="30" FontFamily="Webdings" FontSize="24">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<nBehaviors:DirectionalNavigateAction/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>

			<Button Width="30" Content="4" BorderThickness="1" Margin="0,0,5,0" Height="30" FontFamily="Webdings" FontSize="24">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<nBehaviors:DirectionalNavigateAction Direction="Forward"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>

			<!--<Button Width="100" Content="Page A" BorderThickness="1" Margin="10,0" Height="30">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <nBehaviors:NavigateAction Url="Pages/PageA"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            <Button Width="100" Content="Page B" BorderThickness="1" Margin="10,0" Height="30">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <nBehaviors:NavigateAction Url="Pages/PageB"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            <Button Width="100" Content="Page C" BorderThickness="1" Margin="10,0" Height="30">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <nBehaviors:NavigateAction Url="Pages/PageC"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>-->
		</StackPanel>
		
		<ItemsControl ItemsSource="{Binding SiteMapNodes}" Margin="90,0,0,0">
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<StackPanel Orientation="Horizontal"/>
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Button MinWidth="100" Content="{Binding Title}" BorderThickness="1" Margin="10,0" Height="30">
						<i:Interaction.Triggers>
							<i:EventTrigger EventName="Click">
								<nBehaviors:ExecuteSiteMapNodeAction SiteMapNode="{Binding}"/>
							</i:EventTrigger>
						</i:Interaction.Triggers>
					</Button>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>

	</Grid>

</Window>
